#ifndef SYMBOL_TABLE_H
#define SYMBOL_TABLE_H

#include <string>
#include "../../PascalInterface/SyntaxTree.h"
#include "../../PascalInterface/Position.h"

namespace SimplePascal
{
	using namespace std;

	

	class TypeSymbol
	{
	public:
		enum TypeSymbolType
		{
			typesymbolPRIMITIVE,
			typesymbolPOINTER,
			typesymbolFUNCTION,
			typesymbolPROCEDURE
		}Type;
		int Id;
		PrimitiveDataType primitiveDataType;		//typesymbolPRIMITIVE
		int TypeId;									//typesymbolPOINTER, typesymbolFUNCTION(ReturnType)
		int* ArgumentTypeIds;						//typesymbolFUNCTION, typesymbolPROCEDURE

		TypeSymbol(const TypeSymbol& symbol);
		TypeSymbol(const TypeSymbolType typeSymbolType, const PrimitiveDataType primitiveType);			//primitive
		TypeSymbol(const TypeSymbolType& typeSymbolType, const int typeId);								//pointer
		TypeSymbol(const TypeSymbolType& typeSymbolType, int* arguments);								//procedure
		TypeSymbol(const TypeSymbolType& typeSymbolType, int* arguments, const int returnTypeId);		//function
	};

	class TypeTable
	{
	public:
		TypeSymbol* Data;
		int Count;
	};

	class Symbol
	{
	public:
		enum SymbolType
		{
			symbolPRIMITIVE,
			symbolVARIABLE,
			symbolPARAMETER,
			symbolFUNCTION,
			symbolPROCEDURE
		}Type;
		wstring Identifier;
		int Data;
	};

	class SymbolTable
	{
	public:
		SymbolTable* PreviousTable;
		wstring FunctionName;
		Symbol* Data;
		int Count;
	};
}

#endif